package com.atguigu.gmall.realtime.bean;

import lombok.*;

import java.math.BigDecimal;

/**
 * 地区主题统计实体类
 *
 * @author lvbingbing
 * @date 2022-07-05 22:04
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ProvinceStats {

    /**
     * 窗口起始时间
     */
    private String stt;

    /**
     * 窗口结束时间
     */
    private String edt;

    /**
     * 省份id
     */
    private Long province_id;

    /**
     * 省份名称
     */
    private String province_name;

    /**
     * 地区编码
     */
    private String area_code;

    private String iso_code;

    private String iso_3166_2;

    /**
     * 下单商品金额
     */
    private BigDecimal order_amount;

    /**
     * 订单数
     */
    private Long order_count;

    /**
     * 统计时间
     */
    private Long ts;

    public ProvinceStats(OrderWide orderWide) {
        province_id = orderWide.getProvince_id();
        order_amount = orderWide.getSplit_total_amount();
        province_name = orderWide.getProvince_name();
        area_code = orderWide.getProvince_area_code();
        iso_3166_2 = orderWide.getProvince_iso_code();
        iso_code = orderWide.getProvince_iso_code();

        order_count = 1L;
        ts = System.currentTimeMillis();
    }
}
